<template>
  <div class="f-c">
    <div class="header">
      <div class="title">建设单位意见</div>
    </div>
    <div class="table-box">
      <el-table
        v-loading="loading"
        height="100%"
        :data="tableData"
        element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(255, 255, 255, 0.8)"
        @selection-change="onSelect"
      >
        <el-table-column v-for="item in columns" :key="item.prop" :prop="item.prop" :label="item.label" align="center" />
      </el-table>
    </div>
    <div class="page-box">
      <el-pagination
        background
        :current-page="pageNo"
        :page-sizes="pageSizes"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="totalSize"
        @size-change="changePageSize"
        @current-change="changePageNo"
      />
    </div>
    <div class="header">
      <div class="title">会议纪要编制</div>
    </div>
    <SubmitForm
      :rule-form="ruleForm"
      :rules="rules"
      :form-list="formList"
      :show-close="false"
      @save="onSave"
    />
  </div>
</template>

<script>
import { http } from '@/api'
import crud from '@/mixins/crud'
export default {
  name: 'BuildComment',
  mixins: [crud],
  props: {
    currentDetail: Object
  },
  data() {
    return {
      request: {
        page: http.admin_engineering.build_comment
      },
      columns: [
        { prop: 'departName', label: '建设单位名称' },
        { prop: 'industryName', label: '行业' },
        { prop: 'assess', label: '评审意见' }
      ],
      ruleForm: {
        meetingContent: ''
      },
      rules: {
        meetingContent: [{ required: true, message: '不能为空' }]
      },
      formList: [
        {
          key: 'meetingContent',
          name: 'input',
          label: '',
          type: 'textarea',
          colSpan: 24
        }
      ]
    }
  },
  methods: {
    getQueryParams() {
      const params = {
        projectId: this.currentDetail.id,
        pageNo: this.pageNo,
        pageSize: this.pageSize
      }
      return params
    },
    onSave() {
      http.admin_engineering.build_comment_create({
        projectId: this.currentDetail.id,
        meetingContent: this.ruleForm.meetingContent
      }).then(res => {
        this.$message.success(res.msg)
      })
    }
  }
}
</script>

<style scoped lang="scss">
</style>
